package com.trkj.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.SessionAttributes;

import com.trkj.pojo.Emp;
/**
 * 已办流程的控制器
 * @author Lixd
 *
 */
import com.trkj.service.OriginalProcessService;
@Controller
@SessionAttributes({"emp", "funcIds"})
public class OriginalProcessController {
	@Autowired
	OriginalProcessService originalProcessService;
	@RequestMapping("/find_original_process")
	@ResponseBody
	public Map<String, Object> getPageOriginal(Model model, String processId, String processType, String name,
			Integer page, Integer rows) {
		Integer useid = getOnLineEmp(model);
		if (useid!=null) {
			return originalProcessService.getPageOriginal(useid, processId, processType, name, page, rows);
		}
		return null;
	}
	/**
	 * 获取登录人的id
	 * @author Lixd
	 * @param model
	 * @return
	 */
	private Integer getOnLineEmp(Model model) {
		Emp emp = (Emp)model.asMap().get("emp");
		Integer useid = emp.getEmpId();
		return useid;
	}
}
